import request from "/@/utils/request"

export function fetchList(query?: Object) {
  return request({
    url: '/train/tkglQuestionList/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj?: Object) {
  return request({
    url: '/train/tkglQuestionList',
    method: 'post',
    data: obj
  })
}

export function getObj(id?: string) {
  return request({
    url: '/train/tkglQuestionList/' + id,
    method: 'get'
  })
}

export function delObjs(ids?: Object) {
  return request({
    url: '/train/tkglQuestionList',
    method: 'delete',
    data: ids
  })
}

export function putObj(obj?: Object) {
  return request({
    url: '/train/tkglQuestionList',
    method: 'put',
    data: obj
  })
}
export function questionList(obj?: Object) {
  return request({
    url: '/train/tkglQuestionList/import',
    method: 'post',
    data: obj
  })
}
export function editList(id?: string) {
  return request({
    url: '/train/tkglQuestionList/'+ id,
    method: 'get',
  })
};
export function replace(replaceMarktmp?: string, redisKeyest?: string) {
  return request({
    url: '/train/tkglQuestionList/replace',
    method: 'get',
    params: {
      replaceMark: replaceMarktmp, // 根据传入的参数动态构建
      redisKey: redisKeyest
    }
  })
}

export function downloadList(query?: Object) {
  return request({
    url: '/train/tkglQuestionList/local/questions.xlsx',
    method: 'get',
    params: query
  })
}

